package com.ruoyi.qiushi.service.equipment.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.equipment.QiushiDeviceType;
import com.ruoyi.qiushi.mapper.equipment.QiushiDeviceTypeMapper;
import com.ruoyi.qiushi.service.equipment.IQiushiDeviceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 设备类型Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-22
 */
@Service
public class QiushiDeviceTypeServiceImpl implements IQiushiDeviceTypeService {
    @Autowired
    private QiushiDeviceTypeMapper qiushiDeviceTypeMapper;

    /**
     * 查询设备类型
     *
     * @param id 设备类型主键
     * @return 设备类型
     */
    @Override
    public QiushiDeviceType selectQiushiDeviceTypeById(Long id) {
        return qiushiDeviceTypeMapper.selectQiushiDeviceTypeById(id);
    }

    /**
     * 查询设备类型列表
     *
     * @param qiushiDeviceType 设备类型
     * @return 设备类型
     */
    @Override
    public List<QiushiDeviceType> selectQiushiDeviceTypeList(QiushiDeviceType qiushiDeviceType) {
        return qiushiDeviceTypeMapper.selectQiushiDeviceTypeList(qiushiDeviceType);
    }

    /**
     * 新增设备类型
     *
     * @param qiushiDeviceType 设备类型
     * @return 结果
     */
    @Override
    public int insertQiushiDeviceType(QiushiDeviceType qiushiDeviceType) {
        qiushiDeviceType.setCreateTime(DateUtils.getNowDate());
        return qiushiDeviceTypeMapper.insertQiushiDeviceType(qiushiDeviceType);
    }

    /**
     * 修改设备类型
     *
     * @param qiushiDeviceType 设备类型
     * @return 结果
     */
    @Override
    public int updateQiushiDeviceType(QiushiDeviceType qiushiDeviceType) {
        qiushiDeviceType.setUpdateTime(DateUtils.getNowDate());
        return qiushiDeviceTypeMapper.updateQiushiDeviceType(qiushiDeviceType);
    }

    /**
     * 删除设备类型信息
     *
     * @param id 设备类型主键
     * @return 结果
     */
    @Override
    public int deleteQiushiDeviceTypeById(Long id) {
        return qiushiDeviceTypeMapper.deleteQiushiDeviceTypeById(id);
    }
}
